<template>
  <!--单例模式，name相同则复用一个无界实例，改变url则子应用重新渲染实例到对应路由 -->
  <WujieVue width="100%" height="100%" name="other" :url="otherUrl" :sync="true"></WujieVue>
</template>

<script>
import hostMap from "../hostMap";
import wujieVue from "wujie-vue2";

export default {
  name: "Other",
  data() {
    return {
      otherUrl: hostMap("//localhost:10050/wujie-test/microapp-other/"),
    };
  },
  watch: {
    "$route.params.path": {
      handler: function () {
        // 主应用主动告知子应用路由跳转
        wujieVue.bus.$emit("other-router-change", `/`);
      },
      immediate: true,
    },
  },
}
</script>

<style scoped>

</style>
